package com.fish.anne.dao.ibatis;

import java.util.HashSet;
import java.util.List;

import org.springframework.security.userdetails.UsernameNotFoundException;

import com.fish.anne.model.Member;
import com.fish.anne.model.Role;
import com.fish.anne.model.User;
import com.fish.anne.webapp.formbean.MemberSearch;
import com.fish.anne.dao.MemberDao;
import com.fish.anne.dao.ibatis.GenericDaoiBatis;

public class MemberDaoiBatis extends GenericDaoiBatis<Member, Long> implements MemberDao {

    public MemberDaoiBatis() {
        super(Member.class);
    }
    
    public Member getMemberByUserName(String userName){
    	Member user = (Member) getSqlMapClientTemplate().queryForObject("getMemberByUserName", userName);
    	return user;
    }
    
    public Long getCountOfSearch(MemberSearch memberSearch){
    	return (Long)getSqlMapClientTemplate().queryForObject("getMemberCountOfSearch", memberSearch);
    }
	public List<Member> findBySearch(MemberSearch memberSearch){
		return getSqlMapClientTemplate().queryForList("findMemberBySearch", memberSearch);
	}
}
